package cn.edu.xmu.orderpayment.order.microservice.service;

import cn.edu.xmu.orderpayment.order.microservice.retvo.PaymentRetVo;
import cn.edu.xmu.orderpayment.order.microservice.retvo.RefundRetVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "payment-service")
public interface PayService {
    @GetMapping("internal/document/{documentId}/payment")
    InternalReturnObject<List<PaymentRetVo>> getPaymentByDocumentId(@PathVariable("documentId")String documentId);

    @GetMapping("internal/document/{documentId}/refund")
    InternalReturnObject<List<RefundRetVo>> getRefundByDocumentId(@PathVariable String documentId);

    @PostMapping("internal/document/{documentId}/refund")
    InternalReturnObject refund(@PathVariable String documentId,@RequestParam Long amount,@RequestParam Byte documentType,@RequestParam String descr);

    @PostMapping("internal/document/{documentId}/refund/all")
    InternalReturnObject refundAll(@PathVariable String documentId,@RequestParam Byte documentType,@RequestParam String descr);


}
